package com.example.demo.reflect.cglib;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author void
 * @date 2022/2/17 14:56
 * @desc
 */
public class MyMethodInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println(">>>>MethodInterceptor start...");
        Object result = methodProxy.invokeSuper(o,objects);
        System.out.println(">>>>MethodInterceptor ending...");
        return result;
    }
}
